<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 
$language = &JFactory::getLanguage();
$language->load('vmtheme_reviews');
?>

<h3>
	<?php echo JText::_('REVIEWS_TITLE'); ?>
</h3>

<?php 
foreach( $reviews as $review ) {
	$date = vmFormatDate( $review["time"], $VM_LANG->_('DATE_FORMAT_LC') );
	?>

	<blockquote class="review">
		<div class="ssmed_review_rating">
			<?php echo JText::_('MY_RATING'); ?>:
			<img src="<?php echo VM_THEMEURL ?>images/stars/<?php echo $review["user_rating"] ?>.png"  alt="<?php echo $review["user_rating"] ?> <?php echo JText::_('RATING_STARS'); ?>"/>
		</div>
		<span class="ssmed_review_infos">
			<?php echo $review["username"]?> <?php echo JText::_('TOLD_AT'); ?> <?php echo $date; ?>
		</span>
		<p>
			<?php echo wordwrap($review['comment'], 150, "<br/>\n", true ); ?>
		</p>
	</blockquote>	
	<?php
	}
if( $num_rows < 1 ) { ?>
  <div class="ssmed_review_info_text">
  	<?php echo JText::_('NO_REVIEWS')." <br />";
  		if (!empty($my->id)) {
  			echo JText::_('BE_THE_FIRST_REVIEWER');
  			echo '</div>';
  			}
  		else {
  			echo JText::_('LOGiN_TO_REVIEW');
  			echo '</div>';
  			}
			}
		if( !$showall && $num_rows >=4 ) {
			echo "<a href=\"".$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."&showall=1\">".JText::_('MORE')."</a>";
			}
	?>